package piconode.ext;

import piconode.core.operator.ActivationFunctionWithDerivative;

/*
 * Created on 6 janv. 2005
 * bredeche(at)lri(point)fr
 * 
 */

public class ActivationFunction_LinearWithDecay extends ActivationFunctionWithDerivative {

	private double _decay = 0.9;

	public ActivationFunction_LinearWithDecay() {

	}

	public ActivationFunction_LinearWithDecay(double __decay) {
		_decay = __decay;
	}

	@Override
	public double applyFunction(double __value) // f(x) = x * decay
	{
		return (__value * _decay);
	}

	/**
	 * compute derivative of f(x), which is for this special function the decay
	 * value ( (ax)' = a ) parameter value is unused (asked for compliance with
	 * method prototype)
	 */
	@Override
	public double applyDerivativeFunction(double __value) // (ax)' = a
	{
		return (_decay);
	}
}
